<?php
declare (strict_types = 1);
namespace app\course\model\classes;

use app\course\model\base\Course as BaseCourse;

/**
 * 班级课程--后台管理
 */
class Classes extends BaseCourse
{
    /**
     * 定义字段类型
     * @var array
     */
    protected $type = [
        'id'               => 'integer',
        'status'           => 'integer',
        'mhm_id'           => 'integer',
        'teacher_id'       => 'integer',
        'update_time'      => 'integer',
        'listing_time'     => 'integer',
        'fullcategorypath' => 'json',
        'ext_data'         => 'json',
    ];
    /**
     * 时间显示格式
     * @var string
     */
    protected $dateFormat = 'Y-m-d H:i';
    
    /**
     * 全局查询范围
     * @var [type]
     */
    protected $globalScope = ['courseType'];

    /**
     * 定义查询设备类型范围条件
     * Author   Martinsun<syh@sunyonghong.com>
     * Date 2020-03-10
     * @param    [type]                         $query [description]
     * @return   [type]                                [description]
     */
    public function scopeCourseType($query)
    {
        $query->partition('p4');
    }

}
